package com.mall.ibatis.persistence.sqlmapdao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.mall.ibatis.bean.Function;
import com.mall.ibatis.bean.Method;
import com.mall.ibatis.persistence.iface.FunctionDAO;
import com.ibatis.dao.client.DaoManager;

public class FunctionOracleDAO  extends BaseSqlMapDao implements FunctionDAO
{

	public FunctionOracleDAO(DaoManager daoManager) { 
	    super(daoManager);
	  }
	
	//用户登录方法过滤操作
	@SuppressWarnings("unchecked")
	public List<String> methodFilter(String menuId,String userId) {
		Map<String,String> map = new HashMap<String,String>();
		map.put("menuid",menuId);
		map.put("userid",userId);
		List<String> list = queryForList("method_filter",map);
		return list;
	}
	
	
	@SuppressWarnings("unchecked")
	public List<Function> selectFunction(String functionParentID)
	{
		// TODO Auto-generated method stub
		return queryForList("select_functions_by_paraent_id", functionParentID);
	}

	@SuppressWarnings("unchecked")
	public List<Function> selectFunctionsRights(String parentID,String orOperatorId) {
		Map<String,String> map = new HashMap();
		map.put("parentId",parentID);
		map.put("orOperatorId",orOperatorId);
		List<Function> list = queryForList("select_functions_rights",map);
		return list;
	}


	//查找某个功能中所有的方法
	@SuppressWarnings("unchecked")
	public List<Method> methodAllFilter(String menuId) {
		return queryForList("method_all_filter",menuId);
	}





}
